// CICD
// cargo fmt --all -- --check
// cargo clippy --workspace --all-targets --all-features -- -D warnings -A clippy::type_complexity

// Release
// set Cargo.toml version
// cargo build --target {target} --release
// iced_src = target/{target}/release/localnatice_iced + {suffix}
// host_src = target/{target}/release/localnative-web-ext-host + {suffix}
// dst = dist/localnative-{target}-{version}
// cp iced_src dst
// cp host_src dst
// gzip(&src, &dst.with_extension("gz"))?;

xflags::xflags! {
    src "./src/flags.rs"
    cmd xtask {
        default cmd help {
            /// Print help information.
            optional -h, --help
        }
        /// Release iced and web-ext-host
        cmd release
        {
            /// Select opengl as the backend
            optional --opengl
            /// You can specify a target
            optional -t, --target target: String
            /// You can specify a platform, such as macos, windows, linux
            optional -p, --platform platform: String
            /// You can specify a version
            optional -v, --version version: String
        }
    }
}
// generated start
// The following code is generated by `xflags` macro.
// Run `env UPDATE_XFLAGS=1 cargo build` to regenerate.
#[derive(Debug)]
pub struct Xtask {
    pub subcommand: XtaskCmd,
}

#[derive(Debug)]
pub enum XtaskCmd {
    Help(Help),
    Release(Release),
}

#[derive(Debug)]
pub struct Help {
    pub help: bool,
}

#[derive(Debug)]
pub struct Release {
    pub opengl: bool,
    pub target: Option<String>,
    pub platform: Option<String>,
    pub version: Option<String>,
}

impl Xtask {
    pub const HELP: &'static str = Self::HELP_;

    pub fn from_env() -> xflags::Result<Self> {
        Self::from_env_()
    }

    pub fn from_vec(args: Vec<std::ffi::OsString>) -> xflags::Result<Self> {
        Self::from_vec_(args)
    }
}
// generated end
